package com.cskaoyan.javase.object._5clone;
/**
 * 测试空接口的作用
 *
 * @since 16:48
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo2 {
    public static void main(String[] args) {
        Teacher t = new Teacher();
        judgeInstanceImplCloneable(t);
    }

    public static void judgeInstanceImplCloneable(Object o){
        if (o instanceof Cloneable){
            System.out.println("你实现了这个接口，让你做克隆操作！");
            return;
        }
        System.out.println("你没有实现接口，禁止克隆，抛出异常！");
    }
}

interface Cloneable{
}
class Teacher implements Cloneable{}